import Taro from '@tarojs/taro'
import { View } from '@tarojs/components'
import './index.scss'

export default function TabBar({current, onClick, values = []}) {
  return (
    <View className='tabBar-container'>
      <View className='tabBar-wrapper'>
        {
          values.map((value, index) => (
            <View
              key={index}
              className={`tab ${current === index ? 'active' : ''}`}
              onClick={() => onClick(index)}
            >{value}</View>
          ))
        }
      </View>
    </View>
  )
}

